import request from "../plugin/request";

// 收益统计
export function getStaflow(gid) {
  console.log(gid);
  const url = `/mxd/distri/statflow?gid=${gid}&channelId=0`;

  return request.get(
    url,
    {},
    {
      headers: {
        "Content-Type": "application/json",
      },
    }
  );
}

// 收益详情列表
export function getIncomeList(
  pageNum = 1,
  gid,
  pageSize = 10,
  fromNickname,
  status
) {
  const url = `/mxd/distri/income?pageNum=${pageNum}&pageSize=${pageSize}`;
  return request.post(
    url,
    {
      fromNickname: fromNickname,
      gid: gid,
      channelId: 0,
      payStatus: status
    },
    {
      headers: {
        "Content-Type": "application/json",
      },
    }
  );
}

// 导出功能接口
export function exportData(gid) {
  const url = `/mxd/distri/order/export?gid=${gid}`;
  return request.get(url, { responseType: "arraybuffer" });
}
